using UnityEngine;
using System.Collections;

public class PlayerCollisions : MonoBehaviour 
{
	public GameObject explosion = null;
	
	void OnTriggerEnter(Collider other)
	{
		switch(other.tag)
		{	
			
		case "EnemyProjectile":
			//Create the explosion
			Instantiate(explosion, transform.position, Quaternion.identity);
			
			//Destroy the projectile
			Destroy(other.gameObject);
			
			//Call the player killed method from the game manager class
			GameManager.PlayerDies();
			
			//Destroy the enemy
			Destroy(gameObject);
			
			break;
		}
	}
}
